﻿/**
 * 
 * @file   FITKAcousticsContourPlotData.h
 * @brief  后处理云图参数设置数据
 * @author TanDongYang (tandongyang@diso.cn)
 * @date   2024-11-25
 * 
 */

#ifndef FITKACOUSTICSCONTOURPLOTDATA_H
#define FITKACOUSTICSCONTOURPLOTDATA_H

#include "FITKAcousticsPostDataAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractNDataObject.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataManager.hpp"
#include <QColor>

namespace Acoustics
{
    /**
     * @brief   后处理云图参数设置数据
     * @author  TanDongYang (tandongyang@diso.cn)
     * @date    2024-11-25 
     */
    class FITKAcousticsPostDataAPI FITKAcousticsContourPlotData : public Core::FITKAbstractNDataObject
    {
    public:

        /**
         * @brief   工程单位类型
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-28 
         */
        enum EngUnitsType
        {
            Pressure = 0,        ///< 声压
            Velocity = 1,        ///< 速度
        };
        Q_ENUM(EngUnitsType);

        explicit FITKAcousticsContourPlotData() = default;

        virtual ~FITKAcousticsContourPlotData() = default;

        int getSelectedHzIndex() const { return _selectedHzIndex; }
        void setSelectedHzIndex(int val) { _selectedHzIndex = val; }

        bool getDisplay() const { return _display; }
        void setDisplay(bool val) { _display = val; }

        bool getIsOverall() const{ return _isOverall; }
        void setIsOverall(bool val) { _isOverall = val; }

        QString getSelectedLoadCase() const { return _selectedLoadCase; }
        void setSelectedLoadCase(QString val) { _selectedLoadCase = val; }

        EngUnitsType getSelectedEngUnitsType() const { return _selectedEngUnitsType; }
        void setSelectedEngUnitsType(EngUnitsType val) { _selectedEngUnitsType = val; }


        bool getVelocity_IsLog() const { return _velocity_IsLog; }
        void setVelocity_IsLog(bool val) { _velocity_IsLog = val; }

        bool getVelocity_DB() const { return _velocity_DB; }
        void setVelocity_DB(bool val) { _velocity_DB = val; }

        bool getVelocity_Autoscale() const { return _velocity_Autoscale; }
        void setVelocity_Autoscale(bool val) { _velocity_Autoscale = val; }

        bool getVelocity_AWeighting() const { return _velocity_AWeighting; }
        void setVelocity_AWeighting(bool val) { _velocity_AWeighting = val; }

        double getVelocity_Min() const { return _velocity_Min; }
        void setVelocity_Min(double val) { _velocity_Min = val; }

        double getVelocity_Max() const { return _velocity_Max; }
        void setVelocity_Max(double val) { _velocity_Max = val; }

        double getVelocity_Ref() const { return _velocity_Ref; }
        void setVelocity_Ref(double val) { _velocity_Ref = val; }


        bool getPressure_IsLog() const { return _pressure_IsLog; }
        void setPressure_IsLog(bool val) { _pressure_IsLog = val; }

        bool getPressure_DB() const { return _pressure_DB; }
        void setPressure_DB(bool val) { _pressure_DB = val; }

        bool getPressure_Autoscale() const { return _pressure_Autoscale; }
        void setPressure_Autoscale(bool val) { _pressure_Autoscale = val; }

        bool getPressure_AWeighting() const { return _pressure_AWeighting; }
        void setPressure_AWeighting(bool val) { _pressure_AWeighting = val; }

        double getPressure_Min() const { return _pressure_Min; }
        void setPressure_Min(double val) { _pressure_Min = val; }

        double getPressure_Max() const { return _pressure_Max; }
        void setPressure_Max(double val) { _pressure_Max = val; }

        double getPressure_Ref() const { return _pressure_Ref; }
        void setPressure_Ref(double val) { _pressure_Ref = val; }


        bool getBeams_Flexure_X() const { return _beams_Flexure_X; }
        void setBeams_Flexure_X(bool val) { _beams_Flexure_X = val; }

        bool getBeams_Flexure_Y() const { return _beams_Flexure_Y; }
        void setBeams_Flexure_Y(bool val) { _beams_Flexure_Y = val; }

        bool getBeams_Extension() const { return _beams_Extension; }
        void setBeams_Extension(bool val) { _beams_Extension = val; }

        bool getBeams_Torsion() const { return _beams_Torsion; }
        void setBeams_Torsion(bool val) { _beams_Torsion = val; }

        bool getTransverse_Flexure() const { return _Transverse_Flexure; }
        void setTransverse_Flexure(bool val) { _Transverse_Flexure = val; }

        bool getIn_plane_Extension() const { return _In_plane_Extension; }
        void setIn_plane_Extension(bool val) { _In_plane_Extension = val; }

        bool getIn_plane_Shear() const { return _In_plane_Shear; }
        void setIn_plane_Shear(bool val) { _In_plane_Shear = val; }


        bool getIs_Colors_Continuous() const { return _isColorsContinuous; }
        void setIs_Colors_Continuous(bool val) { _isColorsContinuous = val; }

        int getColors_Discrete_Use() const { return _colorDiscreteUse; }
        void setColors_Discrete_Use(int val) { _colorDiscreteUse = val; }
        
        double getTransparency_mid() const { return _transparency_mid; }
        void setTransparency_mid(double val) { _transparency_mid = val; }

        QColor getColor_max() const { return _color_max; }
        void setColor_max(QColor val) { _color_max = val; }

        double getTransparency_max() const { return _transparency_max; }
        void setTransparency_max(double val) { _transparency_max = val; }

        QColor getColor_min() const { return _color_min; }
        void setColor_min(QColor val) { _color_min = val; }

        double getTransparency_min() const { return _transparency_min; }
        void setTransparency_min(double val) { _transparency_min = val; }

        bool getIsLineShow() const { return _isLineShow; }
        void setIsLineShow(bool val) { _isLineShow = val; }

        QColor getColor_Line() const { return _color_Line; }
        void setColor_Line(QColor val) { _color_Line = val; }

    protected:

        /**
         * @brief   启用云图模式
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _display = false;
        
        /**
         * @brief   选择的Hz索引值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        int _selectedHzIndex{};

        /**
         * @brief   启用Overall
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _isOverall = false;

        /**
         * @brief   选择的工况载荷名称
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        QString _selectedLoadCase{};

        /**
         * @brief   选择的工程单位类型
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        EngUnitsType _selectedEngUnitsType{};

        /**
         * @brief   速度的log显示
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _velocity_IsLog = false;

        /**
         * @brief   速度的DB显示
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _velocity_DB = false;

        /**
         * @brief   速度的DB参考值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _velocity_Ref{ 1.0 };

        /**
         * @brief   速度的A权显示
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _velocity_AWeighting = false;

        /**
         * @brief   速度的自动比例
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _velocity_Autoscale = true;

        /**
         * @brief   速度的手动最小值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _velocity_Min{ 0.0 };

        /**
         * @brief   速度的手动最大值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _velocity_Max{ 0.0 };

        /**
         * @brief   声压的Log显示
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _pressure_IsLog = false;

        /**
         * @brief   声压的DB显示
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _pressure_DB = false;

        /**
         * @brief   声压的DB参考值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _pressure_Ref{ 2e-5 };

        /**
         * @brief   声压的A权显示
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _pressure_AWeighting = false;

        /**
         * @brief   声压的自动比例
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _pressure_Autoscale = true;

        /**
         * @brief   声压的手动最小值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _pressure_Min{ 0.0 };


        /**
         * @brief   声压的手动最大值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _pressure_Max{ 0.0 };


        /**
         * @brief   显示梁X方向屈曲值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _beams_Flexure_X = true;

        /**
         * @brief   显示梁Y方向屈曲值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _beams_Flexure_Y = true;

        /**
         * @brief   显示梁的拉伸值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _beams_Extension = false;

        /**
         * @brief   显示梁的扭转值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _beams_Torsion = false;

        /**
         * @brief   横向屈曲值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _Transverse_Flexure = true;

        /**
         * @brief   平面上的拉伸值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _In_plane_Extension = false;

        /**
         * @brief   平面上的剪切值
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _In_plane_Shear = false;

        /**
         * @brief   自动颜色条连续
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _isColorsContinuous = false;

        /**
         * @brief   用户设置颜色条数量
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        int _colorDiscreteUse = 16;

        /**
         * @brief   中间量的透明度
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _transparency_mid = 1.0;

        /**
         * @brief   高于最大值的颜色
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        QColor _color_max = QColor(255, 255, 255);

        /**
         * @brief   高于最大值的透明度
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _transparency_max = 1.0;

        /**
         * @brief   低于最小值的颜色
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        QColor _color_min = QColor(0, 0, 0);

        /**
         * @brief   低于最小值的透明度
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        double _transparency_min = 1.0;

        /**
         * @brief   是否显示线框
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        bool _isLineShow = false;

        /**
         * @brief   线框的颜色
         * @author  TanDongYang (tandongyang@diso.cn)
         * @date    2024-11-25
         */
        QColor _color_Line = QColor(0, 255, 0);
    };

    /**
     * @brief   后处理云图参数设置数据管理器
     * @author  TanDongYang (tandongyang@diso.cn)
     * @date    2024-11-25 
     */
    class FITKAcousticsPostDataAPI FITKAcousticsContourPlotDataManager : public Core::FITKAbstractNDataObject
        , public Core::FITKAbstractDataManager<FITKAcousticsContourPlotData>
    {
        FITKCLASS(Acoustics, FITKAcousticsContourPlotDataManager);
    public:
        explicit FITKAcousticsContourPlotDataManager() = default;
        virtual ~FITKAcousticsContourPlotDataManager() = default;
    };

}

#endif // FITKACOUSTICSCONTOURPLOTDATA_H
